namespace ChoMy.Migrations.ChoMyDbContext
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.BlogCategories",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        DisplayName = c.String(),
                        Name = c.String(),
                        Description = c.String(),
                        Level = c.Int(nullable: false),
                        Priority = c.Int(nullable: false),
                        ImageUrl = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        ParentId = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.BlogCategories", t => t.ParentId)
                .Index(t => t.ParentId);
            
            CreateTable(
                "dbo.BlogPosts",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        Name = c.String(),
                        Summary = c.String(),
                        Description = c.String(),
                        ImageUrl = c.String(),
                        Priority = c.Int(nullable: false),
                        Views = c.Int(nullable: false),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        BlogCategoryId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.BlogCategories", t => t.BlogCategoryId, cascadeDelete: true)
                .Index(t => t.BlogCategoryId);
            
            CreateTable(
                "dbo.BlogComments",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Description = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        ParentId = c.Int(),
                        BlogPostId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.BlogPosts", t => t.BlogPostId, cascadeDelete: true)
                .ForeignKey("dbo.BlogComments", t => t.ParentId)
                .Index(t => t.ParentId)
                .Index(t => t.BlogPostId);
            
            CreateTable(
                "dbo.Brands",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        Name = c.String(),
                        ImageUrl = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Products",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        Name = c.String(),
                        Code = c.String(),
                        Summary = c.String(),
                        Description = c.String(),
                        ListPrice = c.Single(nullable: false),
                        SourceLink = c.String(),
                        Priority = c.Int(nullable: false),
                        Views = c.Int(nullable: false),
                        IsDelete = c.Boolean(nullable: false),
                        IsHidden = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        BrandId = c.Int(nullable: false),
                        CategoryId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Brands", t => t.BrandId, cascadeDelete: true)
                .ForeignKey("dbo.Categories", t => t.CategoryId, cascadeDelete: true)
                .Index(t => t.BrandId)
                .Index(t => t.CategoryId);
            
            CreateTable(
                "dbo.Categories",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        DisplayName = c.String(),
                        Name = c.String(),
                        Level = c.Int(nullable: false),
                        Priority = c.Int(nullable: false),
                        ImageUrl = c.String(),
                        SizeChart = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        ParentId = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Categories", t => t.ParentId)
                .Index(t => t.ParentId);
            
            CreateTable(
                "dbo.CategoryPropertyTypes",
                c => new
                    {
                        CategoryId = c.Int(nullable: false),
                        PropertyTypeId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => new { t.CategoryId, t.PropertyTypeId })
                .ForeignKey("dbo.Categories", t => t.CategoryId, cascadeDelete: true)
                .ForeignKey("dbo.PropertyTypes", t => t.PropertyTypeId, cascadeDelete: true)
                .Index(t => t.CategoryId)
                .Index(t => t.PropertyTypeId);
            
            CreateTable(
                "dbo.PropertyTypes",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        Name = c.String(),
                        Description = c.String(),
                        NameVn = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Properties",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        Name = c.String(),
                        Value = c.String(),
                        Description = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        PropertyTypeId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.PropertyTypes", t => t.PropertyTypeId, cascadeDelete: true)
                .Index(t => t.PropertyTypeId);
            
            CreateTable(
                "dbo.Images",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Url = c.String(),
                        Width = c.Int(nullable: false),
                        Height = c.Int(nullable: false),
                        Priority = c.Int(nullable: false),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        ProductId = c.Int(nullable: false),
                        PropertyId = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Products", t => t.ProductId, cascadeDelete: true)
                .ForeignKey("dbo.Properties", t => t.PropertyId)
                .Index(t => t.ProductId)
                .Index(t => t.PropertyId);
            
            CreateTable(
                "dbo.StyleProperties",
                c => new
                    {
                        StyleId = c.Int(nullable: false),
                        PropertyId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => new { t.StyleId, t.PropertyId })
                .ForeignKey("dbo.Properties", t => t.PropertyId, cascadeDelete: true)
                .ForeignKey("dbo.Styles", t => t.StyleId, cascadeDelete: true)
                .Index(t => t.StyleId)
                .Index(t => t.PropertyId);
            
            CreateTable(
                "dbo.Styles",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        UnitPrice = c.Single(nullable: false),
                        Quantity = c.Int(nullable: false),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        ProductId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Products", t => t.ProductId, cascadeDelete: true)
                .Index(t => t.ProductId);
            
            CreateTable(
                "dbo.OrderStyles",
                c => new
                    {
                        OrderId = c.Int(nullable: false),
                        StyleId = c.Int(nullable: false),
                        Quantity = c.Int(nullable: false),
                    })
                .PrimaryKey(t => new { t.OrderId, t.StyleId })
                .ForeignKey("dbo.Orders", t => t.OrderId, cascadeDelete: true)
                .ForeignKey("dbo.Styles", t => t.StyleId, cascadeDelete: true)
                .Index(t => t.OrderId)
                .Index(t => t.StyleId);
            
            CreateTable(
                "dbo.Orders",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Code = c.String(),
                        Name = c.String(),
                        Address = c.String(),
                        Email = c.String(),
                        Phone = c.String(),
                        PaymentStatus = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Videos",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Url = c.String(),
                        Priority = c.Int(nullable: false),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        ProductId = c.Int(nullable: false),
                        PropertyId = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Products", t => t.ProductId, cascadeDelete: true)
                .ForeignKey("dbo.Properties", t => t.PropertyId)
                .Index(t => t.ProductId)
                .Index(t => t.PropertyId);
            
            CreateTable(
                "dbo.EventProducts",
                c => new
                    {
                        EventId = c.Int(nullable: false),
                        ProductId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => new { t.EventId, t.ProductId })
                .ForeignKey("dbo.Events", t => t.EventId, cascadeDelete: true)
                .ForeignKey("dbo.Products", t => t.ProductId, cascadeDelete: true)
                .Index(t => t.EventId)
                .Index(t => t.ProductId);
            
            CreateTable(
                "dbo.Events",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        Name = c.String(),
                        Description = c.String(),
                        Priority = c.Int(nullable: false),
                        BeginDate = c.DateTime(nullable: false),
                        EndDate = c.DateTime(nullable: false),
                        ImageUrl = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        CategoryId = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Categories", t => t.CategoryId)
                .Index(t => t.CategoryId);
            
            CreateTable(
                "dbo.TrendProducts",
                c => new
                    {
                        TrendId = c.Int(nullable: false),
                        ProductId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => new { t.TrendId, t.ProductId })
                .ForeignKey("dbo.Products", t => t.ProductId, cascadeDelete: true)
                .ForeignKey("dbo.Trends", t => t.TrendId, cascadeDelete: true)
                .Index(t => t.TrendId)
                .Index(t => t.ProductId);
            
            CreateTable(
                "dbo.Trends",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        Name = c.String(),
                        TypeImageUrl = c.String(),
                        ContentImageUrl = c.String(),
                        Priority = c.Int(nullable: false),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Histories",
                c => new
                    {
                        DateTime = c.DateTime(nullable: false),
                        Description = c.String(),
                        Priority = c.Int(nullable: false),
                        HistoryTypeId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.DateTime)
                .ForeignKey("dbo.HistoryTypes", t => t.HistoryTypeId, cascadeDelete: true)
                .Index(t => t.HistoryTypeId);
            
            CreateTable(
                "dbo.HistoryTypes",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Description = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.MasterCategories",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        DisplayName = c.String(),
                        Name = c.String(),
                        Description = c.String(),
                        Level = c.Int(nullable: false),
                        Priority = c.Int(nullable: false),
                        ImageUrl = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        ParentId = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.MasterCategories", t => t.ParentId)
                .Index(t => t.ParentId);
            
            CreateTable(
                "dbo.MasterPosts",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        Name = c.String(),
                        Summary = c.String(),
                        Description = c.String(),
                        ImageUrl = c.String(),
                        Priority = c.Int(nullable: false),
                        Views = c.Int(nullable: false),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        MasterCategoryId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.MasterCategories", t => t.MasterCategoryId, cascadeDelete: true)
                .Index(t => t.MasterCategoryId);
            
            CreateTable(
                "dbo.MasterComments",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Description = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        ParentId = c.Int(),
                        MasterPostId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.MasterPosts", t => t.MasterPostId, cascadeDelete: true)
                .ForeignKey("dbo.MasterComments", t => t.ParentId)
                .Index(t => t.ParentId)
                .Index(t => t.MasterPostId);
            
            CreateTable(
                "dbo.PostGroups",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        Name = c.String(),
                        Description = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Posts",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NameId = c.String(),
                        Name = c.String(),
                        Description = c.String(),
                        Priority = c.Int(nullable: false),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                        PostGroupId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.PostGroups", t => t.PostGroupId, cascadeDelete: true)
                .Index(t => t.PostGroupId);
            
            CreateTable(
                "dbo.Receivers",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Address = c.String(),
                        Email = c.String(),
                        Phone = c.String(),
                        CreatedBy = c.String(),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.RoleGroups",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Description = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.RoleInGroups",
                c => new
                    {
                        RoleId = c.String(nullable: false, maxLength: 128),
                        RoleGroupId = c.Int(nullable: false),
                        Role_Id = c.Int(),
                    })
                .PrimaryKey(t => new { t.RoleId, t.RoleGroupId })
                .ForeignKey("dbo.Roles", t => t.Role_Id)
                .ForeignKey("dbo.RoleGroups", t => t.RoleGroupId, cascadeDelete: true)
                .Index(t => t.RoleGroupId)
                .Index(t => t.Role_Id);
            
            CreateTable(
                "dbo.Roles",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        NameVn = c.String(),
                        DisplayName = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Settings",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Value = c.String(),
                        Description = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.ShoppingCarts",
                c => new
                    {
                        StyleId = c.Int(nullable: false),
                        CreatedBy = c.String(nullable: false, maxLength: 128),
                        Quantity = c.Int(nullable: false),
                    })
                .PrimaryKey(t => new { t.StyleId, t.CreatedBy })
                .ForeignKey("dbo.Styles", t => t.StyleId, cascadeDelete: true)
                .Index(t => t.StyleId);
            
            CreateTable(
                "dbo.UploadFiles",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Url = c.String(),
                        Type = c.String(),
                        IsDelete = c.Boolean(nullable: false),
                        DateCreated = c.DateTime(nullable: false),
                        DateModified = c.DateTime(),
                        CreatedBy = c.String(),
                        ModifiedBy = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.ShoppingCarts", "StyleId", "dbo.Styles");
            DropForeignKey("dbo.RoleInGroups", "RoleGroupId", "dbo.RoleGroups");
            DropForeignKey("dbo.RoleInGroups", "Role_Id", "dbo.Roles");
            DropForeignKey("dbo.Posts", "PostGroupId", "dbo.PostGroups");
            DropForeignKey("dbo.MasterComments", "ParentId", "dbo.MasterComments");
            DropForeignKey("dbo.MasterComments", "MasterPostId", "dbo.MasterPosts");
            DropForeignKey("dbo.MasterCategories", "ParentId", "dbo.MasterCategories");
            DropForeignKey("dbo.MasterPosts", "MasterCategoryId", "dbo.MasterCategories");
            DropForeignKey("dbo.Histories", "HistoryTypeId", "dbo.HistoryTypes");
            DropForeignKey("dbo.TrendProducts", "TrendId", "dbo.Trends");
            DropForeignKey("dbo.TrendProducts", "ProductId", "dbo.Products");
            DropForeignKey("dbo.EventProducts", "ProductId", "dbo.Products");
            DropForeignKey("dbo.EventProducts", "EventId", "dbo.Events");
            DropForeignKey("dbo.Events", "CategoryId", "dbo.Categories");
            DropForeignKey("dbo.Products", "CategoryId", "dbo.Categories");
            DropForeignKey("dbo.Categories", "ParentId", "dbo.Categories");
            DropForeignKey("dbo.Videos", "PropertyId", "dbo.Properties");
            DropForeignKey("dbo.Videos", "ProductId", "dbo.Products");
            DropForeignKey("dbo.StyleProperties", "StyleId", "dbo.Styles");
            DropForeignKey("dbo.Styles", "ProductId", "dbo.Products");
            DropForeignKey("dbo.OrderStyles", "StyleId", "dbo.Styles");
            DropForeignKey("dbo.OrderStyles", "OrderId", "dbo.Orders");
            DropForeignKey("dbo.StyleProperties", "PropertyId", "dbo.Properties");
            DropForeignKey("dbo.Properties", "PropertyTypeId", "dbo.PropertyTypes");
            DropForeignKey("dbo.Images", "PropertyId", "dbo.Properties");
            DropForeignKey("dbo.Images", "ProductId", "dbo.Products");
            DropForeignKey("dbo.CategoryPropertyTypes", "PropertyTypeId", "dbo.PropertyTypes");
            DropForeignKey("dbo.CategoryPropertyTypes", "CategoryId", "dbo.Categories");
            DropForeignKey("dbo.Products", "BrandId", "dbo.Brands");
            DropForeignKey("dbo.BlogComments", "ParentId", "dbo.BlogComments");
            DropForeignKey("dbo.BlogComments", "BlogPostId", "dbo.BlogPosts");
            DropForeignKey("dbo.BlogCategories", "ParentId", "dbo.BlogCategories");
            DropForeignKey("dbo.BlogPosts", "BlogCategoryId", "dbo.BlogCategories");
            DropIndex("dbo.ShoppingCarts", new[] { "StyleId" });
            DropIndex("dbo.RoleInGroups", new[] { "Role_Id" });
            DropIndex("dbo.RoleInGroups", new[] { "RoleGroupId" });
            DropIndex("dbo.Posts", new[] { "PostGroupId" });
            DropIndex("dbo.MasterComments", new[] { "MasterPostId" });
            DropIndex("dbo.MasterComments", new[] { "ParentId" });
            DropIndex("dbo.MasterPosts", new[] { "MasterCategoryId" });
            DropIndex("dbo.MasterCategories", new[] { "ParentId" });
            DropIndex("dbo.Histories", new[] { "HistoryTypeId" });
            DropIndex("dbo.TrendProducts", new[] { "ProductId" });
            DropIndex("dbo.TrendProducts", new[] { "TrendId" });
            DropIndex("dbo.Events", new[] { "CategoryId" });
            DropIndex("dbo.EventProducts", new[] { "ProductId" });
            DropIndex("dbo.EventProducts", new[] { "EventId" });
            DropIndex("dbo.Videos", new[] { "PropertyId" });
            DropIndex("dbo.Videos", new[] { "ProductId" });
            DropIndex("dbo.OrderStyles", new[] { "StyleId" });
            DropIndex("dbo.OrderStyles", new[] { "OrderId" });
            DropIndex("dbo.Styles", new[] { "ProductId" });
            DropIndex("dbo.StyleProperties", new[] { "PropertyId" });
            DropIndex("dbo.StyleProperties", new[] { "StyleId" });
            DropIndex("dbo.Images", new[] { "PropertyId" });
            DropIndex("dbo.Images", new[] { "ProductId" });
            DropIndex("dbo.Properties", new[] { "PropertyTypeId" });
            DropIndex("dbo.CategoryPropertyTypes", new[] { "PropertyTypeId" });
            DropIndex("dbo.CategoryPropertyTypes", new[] { "CategoryId" });
            DropIndex("dbo.Categories", new[] { "ParentId" });
            DropIndex("dbo.Products", new[] { "CategoryId" });
            DropIndex("dbo.Products", new[] { "BrandId" });
            DropIndex("dbo.BlogComments", new[] { "BlogPostId" });
            DropIndex("dbo.BlogComments", new[] { "ParentId" });
            DropIndex("dbo.BlogPosts", new[] { "BlogCategoryId" });
            DropIndex("dbo.BlogCategories", new[] { "ParentId" });
            DropTable("dbo.UploadFiles");
            DropTable("dbo.ShoppingCarts");
            DropTable("dbo.Settings");
            DropTable("dbo.Roles");
            DropTable("dbo.RoleInGroups");
            DropTable("dbo.RoleGroups");
            DropTable("dbo.Receivers");
            DropTable("dbo.Posts");
            DropTable("dbo.PostGroups");
            DropTable("dbo.MasterComments");
            DropTable("dbo.MasterPosts");
            DropTable("dbo.MasterCategories");
            DropTable("dbo.HistoryTypes");
            DropTable("dbo.Histories");
            DropTable("dbo.Trends");
            DropTable("dbo.TrendProducts");
            DropTable("dbo.Events");
            DropTable("dbo.EventProducts");
            DropTable("dbo.Videos");
            DropTable("dbo.Orders");
            DropTable("dbo.OrderStyles");
            DropTable("dbo.Styles");
            DropTable("dbo.StyleProperties");
            DropTable("dbo.Images");
            DropTable("dbo.Properties");
            DropTable("dbo.PropertyTypes");
            DropTable("dbo.CategoryPropertyTypes");
            DropTable("dbo.Categories");
            DropTable("dbo.Products");
            DropTable("dbo.Brands");
            DropTable("dbo.BlogComments");
            DropTable("dbo.BlogPosts");
            DropTable("dbo.BlogCategories");
        }
    }
}
